# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Tobias Kieslich <tobias@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Dominik Ryba <domryba@post.pl>

pkgname=hugin
pkgver=2022.0.0
pkgrel=6
pkgdesc="Panorama photo stitcher"
arch=(loong64 x86_64)
url="http://hugin.sourceforge.net/"
license=(GPL)
depends=(wxwidgets-gtk3 boost-libs libtiff libpano13 libjpeg libpng openexr vigra
         exiv2 glew sqlite lcms2 lapack fftw glu libxi libxmu python
         lensfun enblend-enfuse)
makedepends=(cmake boost tclap mesa swig)
optdepends=('perl-image-exiftool: GPano tags support'
            'dcraw: RAW import using dcraw'
            'darktable: RAW import using darktable'
            'rawtherapee: RAW import using rawtherapee')
source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2)
sha256sums=('97c8562a0ba9a743e0b955a43dfde048b1c60cd9e5f2ee2b69de1a81646e05a7')

build() {
  cmake -B build -S ${pkgname}-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DENABLE_LAPACK=yes \
    -DBUILD_HSI=ON \
    -DUSE_GDKBACKEND_X11=ON
  make -C build
}

package() {
  make -C build DESTDIR="${pkgdir}" install
}
